package com.yiya.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yiya.mapper.InventoryMapper;
import com.yiya.model.InventoryCplex;
import com.yiya.model.InventoryCplexModel;
import com.yiya.model.InventoryStatisticsModel;

@Service("inventoryService")
public class InventoryService {
	@SuppressWarnings("unused")
	private final static Logger log = Logger.getLogger(InventoryService.class);
	
	@Autowired
	private InventoryMapper inventoryMapper;
	
	public List<InventoryCplex> queryByList(InventoryCplexModel bean) {
		Integer rowCount = queryByCount(bean);
		bean.getPager().setRowCount(rowCount);
		List<InventoryCplex> inventorys = inventoryMapper.selectByModel(bean);
		return inventorys;
	}
	
	public int queryByCount(InventoryCplexModel bean){
		return inventoryMapper.countByModel(bean);
	}
	
	public InventoryStatisticsModel queryFooting(InventoryCplexModel bean){
		return inventoryMapper.selectFooting(bean);
	}

}
